﻿<%@ Page Title="" Language="C#" MasterPageFile="~/YUIAspNet.Master" AutoEventWireup="true" CodeBehind="ClientSide.aspx.cs" Inherits="YUIAspNetDemo.AutoComplete.ClientSide" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>YUIAsp.Net Controls : LiveDemo : AutoComplete : Client side events</title>
    <script type="text/javascript">
        function LogEvent(sender, args) {
            if($find("<%= this.logger.ClientID %>"))
                $find("<%= this.logger.ClientID %>").log("AutoComplete event triggered: "+args.eventName, "warn", "YUIAsp.Net");
        }
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>Client side events</h1>

<p>Using the YUIAsp.Net Logger control, logs are written with WARN level for each event that is raised by the AutoComplete control and handled through the LogEvent handler.</p>


<p style="position:relative"><yui:AutoComplete ID="autocomplete" runat="server" Width="200px"
    OnClientContainerExpand="LogEvent"
    OnClientContainerCollapse="LogEvent"
    OnClientDataRecieved="LogEvent"
    OnClientDataRequested="LogEvent"
    OnClientItemSelected="LogEvent"
    OnClientTextboxFocus="LogEvent"
    OnClientTextboxKeyPressed="LogEvent"
    OnClientTextboxLeave="LogEvent"
 /></p>
<br />
<p>The events that are handled by the LogEvent function are:</p>

<ul>
    <li>OnClientContainerExpand</li>    
    <li>OnClientContainerCollapse</li>    
    <li>OnClientDataRecieved</li>    
    <li>OnClientDataRequested</li>    
    <li>OnClientItemSelected</li>    
    <li>OnClientTextboxFocus</li>    
    <li>OnClientTextboxKeyPressed</li>    
    <li>OnClientTextboxLeave</li>    
</ul>

<p><yui:Logger ID="logger" runat="server" Top="0px" Right="0px" /></p>   

</asp:Content>
